import axios from "axios";
axios.defaults.headers.common["Content-Type"] = "application/json;charset=UTF-8";
axios.defaults.timeout = "2000";

axios.defaults.transformResponse = [function (data) {
  // Do whatever you want to transform the data
  return data;
}];
// Add a request interceptor
axios.interceptors.request.use((config) => {
  // Do something before request is sent
  // vm.$Spin.show();
  return config;
}, function (error) {
  // Do something with request error
  return Promise.reject(error);
});

// Add a response interceptor
axios.interceptors.response.use(function (response) {
  // Do something with response data
  // vm.$Spin.hide();
  return response;
}, function (error) {
  // vm.$Spin.hide();
  // Do something with response error
  return Promise.reject(error);
});
export default axios;
